////////////////////
// Wallpaper
////////////////////
/**
 * Use the `Browser.wallpaper` API to change the ChromeOS wallpaper.
 *
 * Permissions: "wallpaper"
 * @platform ChromeOS only
 * @since Chrome 43
 */
export namespace wallpaper {
    export interface WallpaperDetails {
        /** Optional. The jpeg or png encoded wallpaper image. */
        data?: ArrayBuffer | undefined;
        /** Optional. The URL of the wallpaper to be set. */
        url?: string | undefined;
        /**
         * The supported wallpaper layouts.
         * One of: "STRETCH", "CENTER", or "CENTER_CROPPED"
         */
        layout: "STRETCH" | "CENTER" | "CENTER_CROPPED";
        /** The file name of the saved wallpaper. */
        filename: string;
        /** Optional. True if a 128x60 thumbnail should be generated. */
        thumbnail?: boolean | undefined;
    }

    /**
     * Sets wallpaper to the image at url or wallpaperData with the specified layout
     * @param callback
     * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60.
     */
    export function setWallpaper(details: WallpaperDetails, callback?: (thumbnail?: ArrayBuffer) => void): void {
        Wab.callFunctionAsync({ funcName: 'wallpaper.setWallpaper', details }).then(res => {
            callback?.(res)
            return res
        })
    }
}